package com.learning.servlet3x.context;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;

/**
 * ClassName: DynamicFilter
 * Description: 动态添加的 Filter 。既没有web.xml 标签配置，也没有@WebFilter注解
 * Date:  2014/12/06 22:23 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public class DynamicFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("动态添加的 Filter，既没有web.xml 标签配置，也没有@WebFilter注解");
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {

    }
}
